package MyFile;

import java.util.List;
import java.util.Vector;

public class CreateNewSeriaGraph {
    public static void createNewSeriaXls(String fileName, String sheetName,
	    Vector<String> labelsNames, List<List<Double>> answer,
	    boolean richardson) {
	FileHandler.openFile(fileName);
	FileHandler.openNewSheet(sheetName);
	for (String it : labelsNames)
	    FileHandler.addNewLable(it);
	int counter = -1;
	int row = 0;
	for (List<Double> l : answer) {
	    counter++;
	    for (int i = 0; i < l.size(); i++) {
		row = (richardson && counter > 0 && i > 0) ? i + 1
			: (counter == 0) ? 0 : 1;
		System.out.println(i + row + " , " + row + " , " + i);
		if (!(counter == 0 && i == 0))
		    FileHandler.addNewFloatValue(counter, i + row, l.get(i));

	    }
	}

	FileHandler.closeFile();
    }
}
